const { no, ok, ipv6ToV4 } = require('../../utils/utlis');
const holeService = require('../../services/admin/holeService');

module.exports = {
	status: async (req, res, next) => {
		try {
			let { id } = req.body;
			await holeService.status(id);
			res.send(ok());
		} catch (error) {
			res.send(no(error));
		}
	},
	list: async (req, res, next) => {
		try {
			let { pageNum, pageSize, keywords } = req.body;
			let obj = await holeService.list(pageNum, pageSize, keywords);
			res.send(ok(obj));
		} catch (error) {
			res.send(no(error.message));
		}
	},
	del: async (req, res, next) => {
		try {
			let { ids } = req.body;
			await holeService.del(ids);
			res.send(ok());
		} catch (error) {
			res.send(no(error.message));
		}
	}
};
